import { Image } from 'antd';
import { GoodField } from '@/views/components/TableGoods';
import { NumText } from '@/pages/OrderModule/common/components/CommonText/components/NumText';
import CommonInput from '@/pages/OrderModule/common/components/CommonInput';

export function useGoodsColumns() {
  const goodsColumns = [
    {
      title: '商品',
      dataIndex: 'field',
      width: 200,
      render(value, record) {
        return (
          <GoodField
            record={{
              image: record.image,
              name: record.name,
              count: record.count,
              color: record.color,
              goods: record.goods,
              style: record.style,
            }}
            style={record.style}
            config={imageShowConfig}
          />
        );
      },
    },
    {
      title: '商品编码',
      dataIndex: 'field2',
      render(value, record) {
        return <Typography as="s1">{value}</Typography>;
      },
    },
    {
      title: '款式编码',
      dataIndex: 'field2',
      render(value, record) {
        return <Typography as="s1">{value}</Typography>;
      },
    },
    {
      title: '数量',
      dataIndex: 'field2',
      render(value, record) {
        return <NumText as="s1" num={value} />;
      },
    },
    {
      title: '采购价',
      dataIndex: 'field5',
      render(value) {
        return <NumText as="s1" suffix="￥" num={value} />;
      },
    },
    {
      title: '店铺价格',
      dataIndex: 'field5',
      render(value) {
        return <NumText as="s1" suffix="￥" num={value} />;
      },
    },
    {
      title: '单品重量',
      dataIndex: 'field5',
      render(value) {
        return <NumText as="s1" num={value} />;
      },
    },
    {
      title: '可用库存',
      dataIndex: 'field5',
      render(value) {
        return <NumText as="s1" num={value} />;
      },
    },
    {
      title: '支付状态',
      dataIndex: 'field5',
      render(value) {
        return <Typography as="s1">{value}</Typography>;
      },
    },
    {
      title: '操作',
      dataIndex: 'field5',
      render(value) {
        return (
          <>
            <Typography as="s1">已匹配</Typography>
            <Button type="link" block>
              换商品
            </Button>
            <Button type="link" block>
              删除
            </Button>
          </>
        );
      },
    },
  ];

  return {
    goodsColumns,
  };
}
